package pl.edu.agh.iosr.gamblingzone.mainpanel.action;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.richfaces.model.TreeNode;

import java.util.Iterator;
import java.util.List;

import pl.edu.agh.iosr.gamblingzone.dao.DisciplineDAO;
import pl.edu.agh.iosr.gamblingzone.dao.ejb.DisciplineDAOBean;
import pl.edu.agh.iosr.gamblingzone.model.Discipline;
import pl.edu.agh.iosr.gamblingzone.model.Group;

@Stateless
@Name("eventrowaction")
//@Scope(ScopeType.SESSION)

public class EventRowAction implements EventRow {
	@PersistenceContext
	protected EntityManager entityManager;
	
	private String draw="", odds1="", odds2="", name="", closingdate="";
	
	private DisciplineDAO disciplineDAO;
	private List<Discipline> allDisciplines;

	private void setupDAO() {
        if (disciplineDAO == null) {
                disciplineDAO = new DisciplineDAOBean();
                ((DisciplineDAOBean) disciplineDAO).setEntityManager(entityManager);
        }
	}

	private List<Discipline> getAllDisciplines() {
        setupDAO();
        allDisciplines = disciplineDAO.findAll();
        return allDisciplines;
	}

	
	@Out
public String getDraw() {
	// TODO Auto-generated method stub
	return this.draw;
}

	@Out
public String getName() {
	// TODO Auto-generated method stub
	return this.name;
}
	
	@Out
public String getOdds1() {
	// TODO Auto-generated method stub
	return this.odds1;
}

	@Out
public String getOdds2() {
	// TODO Auto-generated method stub
	return this.odds2;
}
	
	@Out
	public String getClosingdate() {
		return this.closingdate;
	}

public void setDraw(String draw) {
	// TODO Auto-generated method stub
	this.draw = draw;
}

public void setName(String name) {
	// TODO Auto-generated method stub
	this.name = name;
}

public void setOdds1(String odds) {
	// TODO Auto-generated method stub
	this.odds1 = odds;
}

public void setOdds2(String odds) {
	// TODO Auto-generated method stub
	this.odds2 = odds;
}

public void setClosingdate(String closingdate) {
	this.closingdate = closingdate;
}
}